---
page_title: "cloudflare_custom_hostname Resource - Cloudflare"
subcategory: ""
description: |-
  Provides a Cloudflare custom hostname (also known as SSL for SaaS) resource.
---

# cloudflare_custom_hostname (Resource)

Provides a Cloudflare custom hostname (also known as SSL for SaaS) resource.

## Example Usage

```terraform
resource "cloudflare_custom_hostname" "example" {
  zone_id  = "0da42c8d2132a9ddaf714f9e7c920711"
  hostname = "hostname.example.com"
  ssl {
    method = "txt"
  }
}
```
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `hostname` (String) Hostname you intend to request a certificate for. **Modifying this attribute will force creation of a new resource.**
- `zone_id` (String) The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**

### Optional

- `custom_metadata` (Map of String) Custom metadata associated with custom hostname. Only supports primitive string values, all other values are accessible via the API directly.
- `custom_origin_server` (String) The custom origin server used for certificates.
- `custom_origin_sni` (String) The [custom origin SNI](https://developers.cloudflare.com/ssl/ssl-for-saas/hostname-specific-behavior/custom-origin) used for certificates.
- `ssl` (Block List) SSL properties used when creating the custom hostname. (see [below for nested schema](#nestedblock--ssl))
- `wait_for_ssl_pending_validation` (Boolean) Whether to wait for a custom hostname SSL sub-object to reach status `pending_validation` during creation. Defaults to `false`.

### Read-Only

- `id` (String) The ID of this resource.
- `ownership_verification` (Map of String)
- `ownership_verification_http` (Map of String)
- `status` (String) Status of the certificate.

<a id="nestedblock--ssl"></a>
### Nested Schema for `ssl`

Optional:

- `bundle_method` (String) A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. Available values: `ubiquitous`, `optimal`, `force`.
- `certificate_authority` (String)
- `custom_certificate` (String) If a custom uploaded certificate is used.
- `custom_key` (String) The key for a custom uploaded certificate.
- `method` (String) Domain control validation (DCV) method used for this hostname. Available values: `http`, `txt`, `email`.
- `settings` (Block List) SSL/TLS settings for the certificate. (see [below for nested schema](#nestedblock--ssl--settings))
- `type` (String) Level of validation to be used for this hostname. Available values: `dv`. Defaults to `dv`.
- `wildcard` (Boolean) Indicates whether the certificate covers a wildcard.

Read-Only:

- `status` (String)
- `validation_errors` (List of Object) (see [below for nested schema](#nestedatt--ssl--validation_errors))
- `validation_records` (List of Object) (see [below for nested schema](#nestedatt--ssl--validation_records))

<a id="nestedblock--ssl--settings"></a>
### Nested Schema for `ssl.settings`

Optional:

- `ciphers` (Set of String) List of SSL/TLS ciphers to associate with this certificate.
- `early_hints` (String) Whether early hints should be supported. Available values: `on`, `off`.
- `http2` (String) Whether HTTP2 should be supported. Available values: `on`, `off`.
- `min_tls_version` (String) Lowest version of TLS this certificate should support. Available values: `1.0`, `1.1`, `1.2`, `1.3`.
- `tls13` (String) Whether TLSv1.3 should be supported. Available values: `on`, `off`.


<a id="nestedatt--ssl--validation_errors"></a>
### Nested Schema for `ssl.validation_errors`

Read-Only:

- `message` (String)


<a id="nestedatt--ssl--validation_records"></a>
### Nested Schema for `ssl.validation_records`

Read-Only:

- `cname_name` (String)
- `cname_target` (String)
- `emails` (List of String)
- `http_body` (String)
- `http_url` (String)
- `txt_name` (String)
- `txt_value` (String)

## Import

Import is supported using the following syntax:

```shell
$ terraform import cloudflare_custom_hostname.example 1d5fdc9e88c8a8c4518b068cd94331fe/0d89c70d-ad9f-4843-b99f-6cc0252067e9
```
